package com.wu.leetcode.leetcode867;

/**
 * Leetcode867-转置矩阵
 *
 * @author lynn
 * @date 2020/10/28 - 22:24
 */
public class Solution {
    public static int[][] transpose(int[][] A) {
        int[][] arr = new int[A[0].length][A.length];
        for (int i = 0; i < A.length; i++) {
            for (int j = 0; j < A[i].length; j++) {
                arr[j][i] = A[i][j];
            }
        }
        return arr;
    }

    public static void main(String[] args) {
        int[][] arr = new int[][]{{1,2,3},{4,5,6}};
        transpose(arr);
    }
}
